﻿<?php


$obj=new mysql($config);

$sql="select * from `role`";
$date=$obj->getCondition($sql);
if(isset($_SERVER['HTTP_X_REQUESTED_WITH'])){
   $username=$_GET['username'];
   $sql="select username from `admin` where `username`='$username'";
   echo json_encode($obj->getOne($sql));
   die;
}



if(!empty($_POST)){

    $row=$obj->insert($_POST,'admin');
    if($row){
        echo '<script>alert("添加成功");</script>';
    }else{
        echo '<script>alert("添加失败");</script>';
    }
}









require_once (VIEW_PATH.'admin/layout.html');

